{include file="inc/header_index_mui.html"}
<link href="css/mui.min.css" rel="stylesheet" />
		<link rel="stylesheet" href="css/aui.css" />
		<link rel="stylesheet" href="css/master.css" />
		<link rel="stylesheet" href="css/shop_tc.css" />
		<script src="js/mui.min.js"></script>
		<script src="https://ss0.bdstatic.com/5aV1bjqh_Q23odCf/static/superman/js/lib/jquery-1.10.2_d88366fd.js"></script>
{include file="inc/footer_menu_mui.html"}
		<div class="mui-content">
			<div class="aui-mar-t-15  hidden">
				<div class="fl aui-col-2 mui-text-center">
					<a href="index.php?ctl=user_center&act=order_list"><img class="aui-col-7" src="image/dd.png" alt="" /></a>
				</div>
				<div class="fl aui-col-2 mui-text-center">
					<a href="index.php?ctl=user_center&act=tihuo_list"><img class="aui-col-7" src="image/ds.png" alt="" /></a>
				</div>
				<div class="fl aui-col-2 mui-text-center">
					<a href="index.php?ctl=uc_address"><img class="aui-col-7" src="image/dz.png" alt="" /></a>
				</div>
				<div class="fl aui-col-2 mui-text-center">
					<a href="index.php?ctl=user_center&act=zhuanzeng_list"><img class="aui-col-7" src="image/zz.png" alt="" /></a>
				</div>
				<div class="fl aui-col-2 mui-text-center">
					<a href="javascript:alert('未开放，请联系管理员')"><img class="aui-col-7" src="image/fx.png" alt="" /></a>
				</div>
			</div>
			<!--头部图标-->

			<div class="mui-row mui-text-center aui-mar-15 nav">
				<div class="mui-col-sm-4 mui-col-xs-4"><button class="shop aui-col-10 aui-background-lightblue aui-color-white">商品</button></div>
				<div class="mui-col-sm-4 mui-col-xs-4"><button class="aui-col-10">礼物</button></div>
				<div class="mui-col-sm-4 mui-col-xs-4"><button class="aui-col-10">其他</button></div>
			</div>
			<!--导航-->


			<div class="aui-pad-b-15 goods">
				<div class="aui-mar-t-5">
					<?if($this->_var['data']['shangpin']):?>
					<?foreach($this->_var['data']['shangpin'] as $k=>$v):?>
					<ul class="mui-table-view">
						<li class="mui-table-view-cell mui-row">
							<div class="mui-col-sm-3 mui-col-xs-3 re">
								<img class="aui-col-8" src="<?=$v['icon']?>" />
								<div class="number ab"><?=$v['num']?></div>
							</div>
							<div class="mui-col-sm-6 mui-col-xs-6 aui-pad-t-5">
								<?=$v['name']?>
								<p class='mui-ellipsis aui-mar-t-5 aui-col-9'><?=$v['brief']?></p>
							</div>
							<div class="mui-col-sm-3 mui-col-xs-3 mui-text-center">
								<div class=" block aui-border-radius-30 aui-background-orange aui-color-white aui-mar-t-10 line-height-30" onclick="tihuo(0,<?=$v['id']?>)">提货</div>
								<div class=" block aui-border-radius-30 aui-background-lightblue aui-color-white aui-mar-t-10 line-height-30" onclick="zengsong(<?=$v['id']?>)">赠送</div>
							</div>
						</li>
					</ul>
					<?endforeach;?>
					<?endif;?>
				</div>
				
				<!--第二种-->
			</div>

			<!--商品结束-->
			<div class="aui-pad-b-15 gift none">
				<?if($this->_var['data']['liwu']):?>
					<?foreach($this->_var['data']['liwu'] as $k=>$v):?>
				<ul class="mui-table-view">
					<li class="mui-table-view-cell mui-row">
						<div class="mui-col-sm-3 mui-col-xs-3 re">
							<img class="aui-col-8" src="<?=$v['icon']?>" />
							<div class="number ab"><?=$v['num']?></div>
						</div>
						<div class="mui-col-sm-6 mui-col-xs-6 aui-pad-t-5">
							<?=$v['name']?>
							<p class='mui-ellipsis aui-mar-t-5 aui-col-9'><?=$v['brief']?></p>
						</div>
						<div class="mui-col-sm-3 mui-col-xs-3 mui-text-center">
							<div class="block aui-border-radius-30 aui-background-orange aui-color-white aui-mar-t-10 line-height-30" onclick="tihuo(1,<?=$v['id']?>)">提货</div>
							<div class="block aui-border-radius-30 aui-background-lightblue aui-color-white aui-mar-t-10 line-height-30" onclick="duihuan(<?=$v['id']?>)">兑换</div>
						</div>
					</li>
				</ul>
					<?endforeach;?>
				<?endif;?>	

			</div>
			<!--礼物结束-->
			<div class="aui-pad-b-15 qita none">
				<?if($this->_var['data']['qita']['rcq_1']>0):?>
					<ul class="mui-table-view">
						<li class="mui-table-view-cell mui-row">
							<div class="mui-col-sm-3 mui-col-xs-3 re">
								<img class="aui-col-8" src="image/shop_one.png">
								<div class="number ab"><?=$this->_var['data']['qita']['rcq_1']?></div>
							</div>
							<div class="mui-col-sm-6 mui-col-xs-6 aui-pad-t-5">
								第一关入场券
								<p class='mui-ellipsis aui-mar-t-5 aui-col-9'></p>
							</div>
							<div class="mui-col-sm-3 mui-col-xs-3 mui-text-center">
								<a href="index.php?ctl=baozangclone&act=mengxiang" class="block aui-border-radius-30 aui-background-orange aui-color-white aui-mar-t-10 line-height-30">使用</a>
							</div>
						</li>
					</ul>	
				<?endif;?>
				<?if($this->_var['data']['qita']['rcq_2']>0):?>
					<ul class="mui-table-view">
						<li class="mui-table-view-cell mui-row">
							<div class="mui-col-sm-3 mui-col-xs-3 re">
								<img class="aui-col-8" src="image/shop_two.png">
								<div class="number ab"><?=$this->_var['data']['qita']['rcq_2']?></div>
							</div>
							<div class="mui-col-sm-6 mui-col-xs-6 aui-pad-t-5">
								第二关入场券
								<p class='mui-ellipsis aui-mar-t-5 aui-col-9'></p>
							</div>
							<div class="mui-col-sm-3 mui-col-xs-3 mui-text-center">
								<a href="index.php?ctl=baozangclone&act=mengxiang" class="block aui-border-radius-30 aui-background-orange aui-color-white aui-mar-t-10 line-height-30">使用</a>
							</div>
						</li>
					</ul>	
				<?endif;?>
			</div>
			<!--其他结束-->

		</div>


		<!----------购买弹窗开始--------->
		<!-------购买弹窗开始---------->

		<!-------购买弹窗开始---------->
	
		<div class="alert_bg" >
			<div class="alert_zs alert_tc ab aui-pad-15 mui-text-center" style="width:80%;height:auto;display:none;">
				<h1 class="aui-color-white">赠送</h1>
				<div class="aui-background-white aui-border-radius-30">
					<input type="number" style="width:80%;margin:0;border:none;" id="search_user_id" />
					<img src="image/search.png" class="re input_id" onclick="search()" style="top:5px;" alt="" />
				</div>
		
				<div class="id aui-pad-10 aui-mar-t-10" style="border-top:1px dotted #fff;display:none;">
					<div class="id1 aui-color-white mui-text-left aui-pad-10" style="display:none;"></div>
					<div class="id2"  style="display:none;">
					<div class="mui-row mui-text-left">
						<div class="mui-col-sm-3 mui-col-xs-3"><img src="" class="aui-col-8" alt="" id="id2_user_logo" /></div>
						<div class="mui-col-sm-9 mui-col-xs-9"><p class="f18" id="id2_user_name"></p><p class="f18">ID:<span id="id2_id"></span></p></div>
					</div>
					
					<div class="mui-numbox aui-mar-t-10">
					  <!-- "-"按钮，点击可减小当前数值 -->
					  <button class="mui-btn mui-numbox-btn-minus" type="button">-</button>
					  <input class="mui-numbox-input" type="number" id="zengsong_num" value="1" />
					  <!-- "+"按钮，点击可增大当前数值 -->
					  <button class="mui-btn mui-numbox-btn-plus" type="button">+</button>
					</div>
					</div>
				</div>
				
				<div class="aui-mar-t-10">
					<button class="cancel mui-btn mui-btn-danger aui-border-radius-30 aui-col-3 aui-mar-r-10">取消</button>
					<button class="mui-btn mui-btn-warning aui-border-radius-30 aui-col-3" onclick="zengsong_go()">赠送</button>
				</div>
			</div>
			<!--赠送  弹窗-->
			
			<div class="alert_th alert_tc ab aui-pad-15 mui-text-center" style="width:80%;height:auto;display:none;">
				<h1 class="aui-color-white">提货</h1>
				<div class="f24 aui-background-white aui-pad-10 aui-border-radius">你确定要提货吗？</div>
				<div class="mui-numbox aui-mar-t-10">
				  <!-- "-"按钮，点击可减小当前数值 -->
				  <button class="mui-btn mui-numbox-btn-minus" type="button">-</button>
				  <input class="mui-numbox-input" type="number" id="tihuo_num" value="1" />
				  <!-- "+"按钮，点击可增大当前数值 -->
				  <button class="mui-btn mui-numbox-btn-plus" type="button">+</button>
				</div>
				
				<div class="aui-mar-t-20">
					<button class="cancel mui-btn mui-btn-danger aui-border-radius-30 aui-col-3 aui-mar-r-10">取消</button>
					<button class="mui-btn mui-btn-warning aui-border-radius-30 aui-col-3" onclick="tihuo_go()">提货</button>
				</div>
			</div>
			<!--兑换   弹窗-->
			<div class="alert_dh alert_tc ab aui-pad-15 mui-text-center" style="width:80%;height:auto;display:none;">
				<h1 class="aui-color-white">兑换</h1>
				<div class="f24 aui-background-white aui-pad-10 aui-border-radius">你确定要兑换吗？</div>
				<div class="mui-numbox aui-mar-t-10">
				  <!-- "-"按钮，点击可减小当前数值 -->
				  <button class="mui-btn mui-numbox-btn-minus" type="button">-</button>
				  <input class="mui-numbox-input" type="number" id="duihuan_num" value="1" />
				  <!-- "+"按钮，点击可增大当前数值 -->
				  <button class="mui-btn mui-numbox-btn-plus" type="button">+</button>
				</div>
				
				<div class="aui-mar-t-20">
					<button class="cancel mui-btn mui-btn-danger aui-border-radius-30 aui-col-3 aui-mar-r-10">取消</button>
					<button class="mui-btn mui-btn-warning aui-border-radius-30 aui-col-3" onclick="duihuan_go()">兑换</button>
				</div>
			</div>
			<!--兑换   弹窗-->
		</div>
		<!--赠送/提货   弹窗-->
<input type="hidden" id="tihuo_type" value="" />
<input type="hidden" id="id" value="" />
<input type="hidden" id="isTrue" value="1" />
<input type="hidden" id="zengsong_user_id" value="0" />
<script>
$(".nav button").each(function(i, e) {
	e.index = i;
	$(e).click(function() {
		$("button").removeClass("aui-background-lightblue aui-color-white");
		$(this).addClass("aui-background-lightblue aui-color-white");
		if(e.index == 0) {
			$(".goods").show();
			$(".gift").hide();
			$(".qita").hide();
			return false;
		}
		if(e.index == 1) {
			$(".goods").hide();
			$(".gift").show();
			$(".qita").hide();
		} else {
			$(".goods").hide();
			$(".gift").hide();
			$(".qita").show();
		}
	})
});
function tihuo(type,id){
	$("#tihuo_type").val(type);
	$("#id").val(id);
	$(".alert_bg").show();
	$(".alert_th").show();
	$(".alert_zs").hide();
	$(".alert_dh").hide();
	$("#id").val(id);
}
function  tihuo_go(){
	var type=$("#tihuo_type").val();
	var num=$("#tihuo_num").val();
	var id=$("#id").val();
	var isTrue = $("#isTrue").val();
	if(isTrue==1){
		$("#isTrue").val(0);
		$.ajax({
			url: 'index.php?ctl=user_center&act=tihuo_go',
			type: 'POST',
			data: 'id=' + id + '&num=' + num +'&type=' + type + '&t=' + Math.random(),
			dataType: "json",
			success: function (data) {
				if(data.status=="1"){
					alert(data.info);
					location.href="";
				}else{
					alert(data.info);
					$("#isTrue").val("1");
				}
			},
			error: function () {
				//alert("系统错误，请联系管理员");
			}
		});	
	}		
}

function zengsong(id){
	$("#id").val(id);
	$(".alert_bg").show();
	$(".alert_zs").show();
	$(".alert_th").hide();
	$(".alert_dh").hide();
	$("#zengsong_user_id").val(0);
}
function search(){
	$(".id").hide();
	$(".id1").hide();
	$(".id2").hide();
	var search_user_id=$("#search_user_id").val();
	if(search_user_id!=''){
		var isTrue = $("#isTrue").val();
		if(isTrue==1){
			$("#isTrue").val(0);
			$.ajax({
				url: 'index.php?ctl=user_center&act=search_user_id',
				type: 'POST',
				data: 'search_user_id=' + search_user_id +'&t=' + Math.random(),
				dataType: "json",
				success: function (data) {
					if(data.status=="1"){
						//alert(data.info);
						$("#id2_user_logo").attr("src",data.info.user_logo);
						$("#id2_user_name").html(data.info.user_name);
						$("#id2_id").html(data.info.id);
						$("#zengsong_user_id").val(data.info.id);						
						$(".id2").show();
						
					}else{
						$(".id1").html(data.info);
						$("#zengsong_user_id").val(0);
						$(".id1").show();
					}
					$(".id").show();
					$("#isTrue").val(1);
				},
				error: function () {
					//alert("系统错误，请联系管理员");
				}
			});	
		}		
	}
}
function zengsong_go(){
	var num=$("#zengsong_num").val();
	var id=$("#id").val();
	var zengsong_user_id=$("#zengsong_user_id").val();
	
	var isTrue = $("#isTrue").val();
	if(isTrue==1){
		$("#isTrue").val(0);
		$.ajax({
			url: 'index.php?ctl=user_center&act=zengsong_go',
			type: 'POST',
			data: 'num=' + num+ '&id=' + id+'&zengsong_user_id=' + zengsong_user_id + '&t=' + Math.random(),
			dataType: "json",
			success: function (data) {
				if(data.status=="1"){
					alert(data.info);
					location.href="";
				}else{
					alert(data.info);
					$("#isTrue").val("1");
				}
			},
			error: function () {
				//alert("系统错误，请联系管理员");
			}
		});	
	}		
}
function duihuan(id){
	$("#id").val(id);
	$(".alert_bg").show();
	$(".alert_dh").show();
	$(".alert_th").hide();
	$(".alert_zs").hide();
}
function duihuan_go(){
	var num=$("#duihuan_num").val();
	var id=$("#id").val();
	
	var isTrue = $("#isTrue").val();
	if(isTrue==1){
		$("#isTrue").val(0);
		$.ajax({
			url: 'index.php?ctl=user_center&act=duihuan_go',
			type: 'POST',
			data: 'num=' + num+ '&id=' + id+ '&t=' + Math.random(),
			dataType: "json",
			success: function (data) {
				if(data.status=="1"){
					alert(data.info);
					location.href="";
				}else{
					alert(data.info);
					$("#isTrue").val("1");
				}
			},
			error: function () {
				//alert("系统错误，请联系管理员");
			}
		});	
	}		
}

$(".cancel").click(function(){
	$(".alert_bg").hide()
	$(".alert_zs").hide()
	$(".alert_th").hide()
	$(".alert_dh").hide()
	$(".id").hide()
})
</script>
	</body>
	
</html>